{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "ba021a3c",
   "metadata": {},
   "outputs": [],
   "source": [
    "def a(aa,bb):\n",
    "    print(aa + bb)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "4ed90469",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "33\n"
     ]
    }
   ],
   "source": [
    "a(11,22)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "1f138a1a",
   "metadata": {},
   "outputs": [],
   "source": [
    "b = lambda aa,bb: print(aa,bb)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "464195b8",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "1 2\n"
     ]
    }
   ],
   "source": [
    "b(1,2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "766cc3d0",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "function"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "type(b)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "id": "fd6d0e06",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "function"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "type(a)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "id": "51a2468e",
   "metadata": {},
   "outputs": [],
   "source": [
    "c = lambda :print(11111)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "id": "bb8887ab",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "11111\n"
     ]
    }
   ],
   "source": [
    "c()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "id": "435a39de",
   "metadata": {},
   "outputs": [],
   "source": [
    "x = 1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "id": "5edb43ec",
   "metadata": {},
   "outputs": [],
   "source": [
    "def d():\n",
    "    print(x+1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "id": "4e2d197b",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "2\n"
     ]
    }
   ],
   "source": [
    "d()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "id": "d0986761",
   "metadata": {},
   "outputs": [],
   "source": [
    "f = lambda : print(x+1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "id": "97ef9de4",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "2\n"
     ]
    }
   ],
   "source": [
    "f()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 60,
   "id": "52ebf96d",
   "metadata": {},
   "outputs": [],
   "source": [
    "c = list(range(1,10))\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 61,
   "id": "49e1b0ad",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[1, 2, 3, 4, 5, 6, 7, 8, 9]"
      ]
     },
     "execution_count": 61,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "c"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "id": "ee325bf0",
   "metadata": {},
   "outputs": [],
   "source": [
    "h = range(11,20)\n",
    "j = [str(i) for i in h]\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 62,
   "id": "e55368ce",
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['11', '12', '13', '14', '15', '16', '17', '18', '19']"
      ]
     },
     "execution_count": 62,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "j"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 66,
   "id": "1a04f5be",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "9"
      ]
     },
     "execution_count": 66,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(j)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 68,
   "id": "7370863d",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[0, 1, 2, 3, 4, 5, 6, 7, 8]"
      ]
     },
     "execution_count": 68,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "list(range(len(j)))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 64,
   "id": "3f38014e",
   "metadata": {},
   "outputs": [],
   "source": [
    "aa = dict([(j[i],c[len(j)-i-1]) for i in range(len(j))])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 65,
   "id": "ce300ab0",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'11': 9,\n",
       " '12': 8,\n",
       " '13': 7,\n",
       " '14': 6,\n",
       " '15': 5,\n",
       " '16': 4,\n",
       " '17': 3,\n",
       " '18': 2,\n",
       " '19': 1}"
      ]
     },
     "execution_count": 65,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "aa"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 50,
   "id": "104c8a13",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "11 12 13 14 15 16 17 18 19\n"
     ]
    }
   ],
   "source": [
    "print(j[0],j[1],j[2],j[3],j[4],j[5],j[6],j[7],j[8])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 56,
   "id": "1561018c",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "9 8 7 6 5 4 3 2 1\n"
     ]
    }
   ],
   "source": [
    "print(c[8],c[7],c[6],c[5],c[4],c[3],c[2],c[1],c[0])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "09af8567",
   "metadata": {},
   "outputs": [],
   "source": [
    "10 9 8 7 6 5 4 3 2 1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 69,
   "id": "a778cb66",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "dict_keys(['11', '12', '13', '14', '15', '16', '17', '18', '19'])"
      ]
     },
     "execution_count": 69,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "aa.keys()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 70,
   "id": "1f45b211",
   "metadata": {},
   "outputs": [],
   "source": [
    "bb = list(aa.keys())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 71,
   "id": "3bcdaa3c",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['11', '12', '13', '14', '15', '16', '17', '18', '19']"
      ]
     },
     "execution_count": 71,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "bb"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 72,
   "id": "2c7b64ff",
   "metadata": {},
   "outputs": [],
   "source": [
    "n = sorted(bb,key=lambda x:aa[x])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 73,
   "id": "8b760471",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['19', '18', '17', '16', '15', '14', '13', '12', '11']"
      ]
     },
     "execution_count": 73,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "2fa255a2",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
